home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / NORAW.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  60 lines

  1. #define CURSES_LIBRARY 1
  2. #include <curses.h>
  3. #undef  noraw
  4.  
  5. #ifndef NDEBUG
  6. char *rcsid_noraw = "$Header: c:/curses/portable/RCS/noraw.c%v 2.0 1992/11/15 03:29:06 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   noraw()      - disable raw mode
  15.  
  16.   X/Open Description:
  17.         The terminal in placed into or out of raw mode.  Raw mode is
  18.         similar to cbreak mode, in that characters typed are immediately
  19.         passed through to the user program.  The differences are that in
  20.         raw mode, the INTR, QUIT, SUSP, and STOP characters are passed
  21.         through without being interpreted, and without generating a
  22.         signal.  The behaviour of the BREAK key depends on other
  23.         parameters of the terminal drive that are not set by curses.
  24.  
  25.   PDCurses Description:
  26.         Raw mode in the traditional sense refers to input handling.
  27.         Contrast noraw_output() which disables 8bit characters.
  28.  
  29.         FYI:   PDCurses does NOT provide signal(3) support,
  30.                this must be done by the application.
  31.  
  32.   X/Open Return Value:
  33.         The noraw() function returns OK on success and ERR on error.
  34.  
  35.   X/Open Errors:
  36.         No errors are defined for this function.
  37.  
  38.   Portability:
  39.         PDCurses        int noraw( void );
  40.         X/Open Dec '88  int noraw( void );
  41.         BSD Curses      int noraw( void );
  42.         SYS V Curses    int noraw( void );
  43.  
  44. **man-end**********************************************************************/
  45.  
  46. int     noraw(void)
  47. {
  48. #ifdef OS2
  49.        KBDINFO KbdInfo;
  50.  
  51.        KbdGetStatus(&KbdInfo,0);
  52.        KbdInfo.fsMask |= KEYBOARD_ASCII_MODE;
  53.        KbdInfo.fsMask &= ~KEYBOARD_BINARY_MODE;
  54.        KbdSetStatus(&KbdInfo,0);
  55. #endif
  56.        _cursvar.raw_inp = FALSE;
  57.        PDC_set_ctrl_break(_cursvar.orgcbr);    /* restore original ^BREAK status */
  58.        return( OK );
  59. }
  60.